<template>
    <div class="showTmpBox">
        <van-swipe-cell>
            <van-cell :border="false" @click="onTitle">
                <template slot="title">
                    <van-cell-group>
                        <!-- <van-cell :title="dataList.order_number" :label="describe ? dataList.status : ''" /> -->
                        <van-cell>
                            <template slot="title" v-if="type === 'number'">
                                {{dataList.order_number}}
                            </template>
                            <template slot="title" v-else-if="type === 'name'">
                                {{dataList.name}}
                            </template>
                            <template slot="title" v-else>
                                {{dataList.patent_name}}
                            </template>
                            
                            <template slot="label">
                                <p class="label">{{describe ? dataList.status : ''}}</p>
                                <div v-if="fieldList">
                                    <div v-for="(field, index) in fieldList"
                                        :key="index">
                                        <van-field
                                        disabled
                                        :border="false"
                                        v-model="field.message"
                                        rows="1"
                                        :autosize="{maxHeight: 70, minHeight: 24 }" 
                                        type="textarea"
                                        />
                                    </div>
                                </div>
                            </template>
                        </van-cell>
                    </van-cell-group>
                </template>
            </van-cell>

            <template slot="right" v-if="isRight">
                <van-button square type="primary" :text="text" @click="onSlider"/>
            </template>
        </van-swipe-cell>
    </div>
</template>

<script>
export default {
    data() {
        return {}
    },
    methods: {
        onTitle() {
            this.$emit('onTitle')
        },
        onSlider() {
            this.$emit('onSlider')
        }
    },
    props: [
        'dataList',
        'text',
        'describe',
        'isRight',
        'fieldList',
        'type',
    ]
}
</script>

<style lang="less" scoped>
    .showTmpBox{
        .van-cell.van-cell--borderless{
            padding: 0
        }

        /deep/ .van-field__control{
            display: -webkit-box;
            overflow: hidden;
            text-overflow: ellipsis;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            font-size: 22px;
            color: #969799;
        }

        /deep/ .van-cell__title{
            max-width: 100%;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .label{
            margin: 0;
        }
    }
</style>